]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
unlockDialog, loginDialog: Connect to the activate signal on the entry
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 5 Mar 2013 07:04:02 +0000 (02:04 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 5 Mar 2013 20:25:11 +0000 (15:25 -0500)
This is the recommended way to connect to an entry's activation binding --
event bubbling is not guaranteed by ClutterText.

https://bugzilla.gnome.org/show_bug.cgi?id=695154

js/gdm/loginDialog.js
js/ui/unlockDialog.js

index cd8dff5f222095efbf17ee3073b96e9616f34495..b1ee384628698cc08aabd0a5f13f9f85c8062523 100644 (file)
@@ -594,6 +594,7 @@ const LoginDialog = new Lang.Class({
         this._promptEntry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
                                            can_focus: true });
         this._promptEntryTextChangedId = 0;
+        this._promptEntryActivateId = 0;
         this._promptBox.add(this._promptEntry,
                             { expand: true,
                               x_fill: true,
@@ -811,6 +812,11 @@ const LoginDialog = new Lang.Class({
                                                     Lang.bind(this, function() {
                                                         this._updateSignInButtonSensitivity(this._promptEntry.text.length > 0);
                                                     }));
+
+        this._promptEntryActivateId =
+            this._promptEntry.clutter_text.connect('activate', function() {
+                hold.release();
+            });
     },
 
     _updateSensitivity: function(sensitive) {
@@ -835,6 +841,11 @@ const LoginDialog = new Lang.Class({
             this._promptEntryTextChangedId = 0;
         }
 
+        if (this._promptEntryActivateId > 0) {
+            this._promptEntry.clutter_text.disconnect(this._promptEntryActivateId);
+            this._promptEntryActivateId = 0;
+        }
+
         this._setWorking(false);
         this._promptBox.hide();
         this._promptLoginHint.hide();
index 8ddb3e3bdc9e2b782dea63495bf213e30390e9c0..1296308baa4cadd336b55ecdaea809360fe85f5c 100644 (file)
@@ -98,6 +98,7 @@ const UnlockDialog = new Lang.Class({
 
         this._promptEntry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
                                            can_focus: true });
+        this._promptEntry.clutter_text.connect('activate', Lang.bind(this, this._doUnlock));
         this._promptEntry.clutter_text.set_password_char('\u25cf');
         ShellEntry.addContextMenu(this._promptEntry, { isPassword: true });
         this.setInitialKeyFocus(this._promptEntry);